package com.example.my_flea_street.service.impl;

import com.example.my_flea_street.Mapper.LoginMapper;
import com.example.my_flea_street.Mapper.UserMapper;
import com.example.my_flea_street.bean.Login;
import com.example.my_flea_street.bean.User;
import com.example.my_flea_street.service.LoginService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service(value = "loginService")
public class LoginServiceImpl implements LoginService {

    @Resource
    LoginMapper loginMapper;

    @Override
    public Login userIsExisted(String phone,String password) {

        return loginMapper.userIsExisted(phone);
    }

    @Override
    public void registerToLogin(String phone, String password) {
        loginMapper.register(phone,password);
    }

    @Override
    public void unRegistToLogin(String phone) {
        loginMapper.unRegist(phone);
    }

    @Override
    public void editPassword(String phone, String password) {
        loginMapper.editPassword(phone,password);
    }

    @Override
    public Login userNameIsExited(String name) {
        return loginMapper.nameIsExited(name);
    }


}
